import { ref } from "vue";

const useTodo = (arr) => {
  const value = ref("");
  const list = ref(arr);

  const add = () => {
    list.value.push(value.value);
  };

  const remove = (i) => {
    list.value = list.value.filter((item) => item !== i);
  };

  return { value, list, add, remove };
};

export default useTodo;
